<?php
if ($this->Session->flash()):
?>
	<div class="alert alert-warning">
		<?php  echo $this->Session->flash();?>
	</div>
<?php
endif;
?>

<div class="row">
	<div class="col-lg-12">
		<h1 class="page-header">Change password</h1>
	</div>
</div>
<?php echo $this->Form->create('Staff' ,array('type' => 'post'));?>
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
	<tr>
		<th width="20%">Current password</th>
		<td>
			<?php
				echo $this->Form->input('Staff.currentPass', array(
					'type' => 'password',
					'label' => false,
					'required' => false,
					'error' => false,
					'placeholder' => 'Current password',
					'id' => 'current_pw_input',
					'div' => false,
					'class' => 'form-control w200',
					'autocomplete' => 'off'

				));

				if (isset($this->validationErrors['Staff']['currentPass'])):
					echo '<p class="error-message">' . __($this->validationErrors['Staff']['currentPass'][0]) . '</p>';
				endif;
			?>
		</td>
	</tr>
	<tr>
		<th>New password</th>
		<td>
			<?php
			echo $this->Form->input('Staff.newPass', array(
				'type' => 'password',
				'label' => false,
				'required' => false,
				'error' => false,
				'placeholder' => 'New password',
				'id' => 'new_pw_input',
				'class' => 'form-control w200',
				'div' => false,
			));

			if (isset($this->validationErrors['Staff']['newPass'])):
				echo '<p class="error-message">' . __($this->validationErrors['Staff']['newPass'][0]) . '</p>';
			endif;
			?>
		</td>
	</tr>

	<tr>
		<th>Confirm password</th>
		<td>
			<?php
				echo $this->Form->input('Staff.confirmPass', array(
					'type' => 'password',
					'label' => false,
					'required' => false,
					'error' => false,
					'placeholder' => 'Confirm password',
					'id' => 'confirm_new_pw_input',
					'class' => 'form-control w200',
					'div' => false,
				));
				echo $this->Form->input('Staff.code', array(
					'type' => 'hidden',
					'default' => $code,
				));
				if (isset($this->validationErrors['Staff']['confirmPass'])):
					echo '<p class="error-message">' . __($this->validationErrors['Staff']['confirmPass'][0]) . '</p>';
				endif;
			?>
		</td>
	</tr>

	<tr>
		<th>&nbsp;</th>
		<td>
			<div class="form-group">
			<?php
			echo $this->Form->button('Submit', array(
					'type' => 'submit',
					'class' => 'btn btn-primary',
					'label' => false,
					'div' => false,
				)
			).'  ';

			echo $this->Form->button('Reset', array(
					'type' => 'reset',
					'class' => 'btn btn-primary',
					'label' => false,
					'div' => false,
				)
			);
			?>
			</div>
		</td>
	</tr>
</table>
<?php echo $this->Form->end()?>